#!/bin/bash
echo "安装jdk11"
cd /app/pmapp/data/rongshu/jdk11/ || exit
echo "jdk环境变量"
new_content="export JAVA_HOME=/app/pmapp/data/rongshu/jdk11"
new_content_1="export CLASSPATH=\$JAVA_HOME/lib:\$CLASSPATH"
new_content_2="export PATH=\$JAVA_HOME/bin:\$PATH"
echo "往配置文件最后一行添加配置"
echo -e "$new_content\n$new_content_1\n$new_content_2" >> ~/.bash_profile
echo "加载配置"
source /app/pmapp/.bash_profile
echo "验证jdk安装版本"
echo "`java -version`"
